<?
include("session.php");
include("quick_search_js.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../webkit/utils/jquery.js"></script>
<script type="text/javascript" src="../webkit/grid/import.js"></script>
<script type="text/javascript" src="../webkit/dialog/import.js"></script>
<script type="text/javascript" src="/webkit/datepicker/WdatePicker.js"></script>
<link type="text/css" rel="stylesheet" href="page.css"/>
</head>
<body>


<table width=100% height=100% cellspacing=0 cellpadding=0>
	<tr bgcolor="#eeeeee">
	<form name=f>
	<td height=30>&nbsp;
    统计时段：<input type="text" id="begin_time" name="begin_time" onClick="WdatePicker({readOnly:true, skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" size="15"> - <input type="text" id="end_time" name="end_time" onClick="WdatePicker({readOnly:true, skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" size="15">　
	<input type="button" value="查询" onclick="search()">　<?show_quick_searh_radio("全部,本月,上月")?>
	</td>
	</tr>
	<tr>
	<td>
		<table id="flex1" style="display:none"></table>
	</td>
	</form>
	</tr>
</table>


<script type="text/javascript">
	<?if($_SESSION['is_agent']=='yes') {?>
	var h = window.screen.height-(115+112+100); // 属于嵌入外部url，只能按screen高度大致计算
	<?} else {?>
	var h = parent.document.body.clientHeight-(115+112);
	if(h < 0) h = 'auto'
	<?}?>
	$("#flex1").flexigrid({
		url: 'client_order_query.php?action=order_count',
		dataType: 'json',
		colModel : [
			{display: '客户编号', name : 'a', width : 100, sortable : false, align: 'center'},
			{display: '客户名称', name : 'b', width : 150, sortable : false, align: 'center'},
			{display: '联系手机', name : 'c', width : 120, sortable : false, align: 'center'},
			{display: '工单数量', name : 'd', width : 150, sortable : false, align: 'center'},
			{display: '关联操作', name : 'e', width : 130, sortable : false, align: 'center'}
			],
		buttons : [],
		async : true,
		usepager: true,
		useRp: true,
		rp: 15,
		showTableToggleBtn: false,
		width: 'auto',
		height: h,
		resizable : false,
		singleSelect : true
	});


	function search() { 
		var url = "client_order_query.php?action=order_count";
        if($("#begin_time").val()!="" && $("#end_time").val()!="") {
			url += "&time_range="+ $("#begin_time").val()+"_"+$("#end_time").val();
		} 
		$('#flex1').flexOptions({'url': url}).flexReload(); 
	}

	<?show_quick_searh_js();?>

</script>
</body>
</html>
